//
//  CXHAdSDKConfigModel.h
//  CXHAdSDK
//
//  Created by 陈坤 on 2022/3/12.
//

#import <Foundation/Foundation.h>
#import "CXHAdapterCommonDefine.h"

NS_ASSUME_NONNULL_BEGIN

@interface CXHChannelInfo : NSObject

@property (nonatomic, copy) CXHAdapterPlatform platformType;
@property (nonatomic, copy) NSString *baseUrl;
@property (nonatomic, copy) NSString *key;
@property (nonatomic, copy) NSString *userID;

@end

@interface CXHAdSDKReportModel : NSObject

@property (nonatomic, copy) NSString *url;
@property (nonatomic, copy) NSString *appid;
@property (nonatomic, copy) NSString *platformType;

- (instancetype)initModelWithJson:(NSDictionary *)json NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)new NS_UNAVAILABLE;

@end


@interface CXHAdSDKPosModel : NSObject

@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *appid;
@property (nonatomic, copy) NSString *posid;
@property (nonatomic, copy) NSString *platformAppid;
@property (nonatomic, copy) NSString *platformPosid;
@property (nonatomic, copy) NSString *platformType;
@property (nonatomic, copy) NSString *adType;
@property (nonatomic, strong) NSArray<NSString *> *reportURLArray;
//@property (nonatomic, copy) NSString *reportURL;
@property (nonatomic, copy) NSString *expand;
@property (nonatomic, assign) NSInteger price;
@property (nonatomic, assign) NSInteger countdown;

- (instancetype)initModelWithJson:(NSDictionary *)json NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)new NS_UNAVAILABLE;
 
@end

@interface CXHAdSDKPlatformModel : NSObject

@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *appid;
@property (nonatomic, copy) NSString *platformAppid;
@property (nonatomic, copy) NSString *platformAppkey;
@property (nonatomic, assign) NSInteger sort;
@property (nonatomic, copy) NSString *platformType;
@property (nonatomic, copy) NSString *baseURL;
//@property (nonatomic, copy) NSString *reportURL;
@property (nonatomic, strong) NSArray<NSString *> *reportURLArray;
@property (nonatomic, copy) NSString *expand;
@property (nonatomic, strong, nullable) CXHAdSDKPlatformModel *nextPlatform;
// posid:CXHAdSDKPosModel
@property (nonatomic, strong, nullable) NSMutableDictionary<NSString*, CXHAdSDKPosModel *> *posModelMap;


- (instancetype)initModelWithJson:(NSDictionary *)json NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)new NS_UNAVAILABLE;

- (CXHAdSDKPosModel *)getPosModel:(NSString *)posid;

@end

@interface CXHAdSDKConfigModel : NSObject
// 链表，当前为顺位第一的平台，动态变化平台顺序不适用该结构
@property (nonatomic, strong, nullable) CXHAdSDKPlatformModel *firstPlatform;

@property (nonatomic, copy) NSString *appKey;

@property (nonatomic, copy) NSString *appSecret;

@property (nonatomic, strong) NSDictionary<CXHAdapterPlatform, CXHChannelInfo *> *channelInfoMap;

- (instancetype)initModelWithJson:(NSDictionary *)json NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)new NS_UNAVAILABLE;

- (CXHAdSDKPlatformModel *)getPlatformModel:(NSString *)platformType;

@end


NS_ASSUME_NONNULL_END
